#ifndef __SLOG_H__
#define __SLOG_H__

#include <stdio.h>
#include <signal.h>

int InitialLog(const char * filename );

void UninitialLog();

void Error( const char* format, ... );

void Info( const char* format, ... );

void Warn( const char* format, ... );

void Debug( const char* format, ... );

void FlushLog();

#ifdef MYDEBUG
#define my_assert(a) \
	{\
		if (!(a)){ \
			printf("%s:%d %s\n", __FILE__, __LINE__, #a);\
			Error("%s:%d %s", __FILE__, __LINE__, #a);\
			raise(SIGINT);\
		}\
	}
#else
#define my_assert(a) \
	{\
		if (!(a)){ \
			printf("%s:%d %s\n", __FILE__, __LINE__, #a);\
			Error("%s:%d %s", __FILE__, __LINE__, #a);\
		}\
	}
#endif

#endif
